#!usr/lib/perl
use 5.012;
use utf8;
use warnings;

sub findIndex{
	my ($what, @from) = @_;
		foreach(0..$#_){
			if($from[$_] eq $what){
				return $_;
				}
			}
		-1;
		}

sub max{
	my ($tempMax) = shift @_;
	foreach(@_){
		if($_> $tempMax ){
			$tempMax = $_;
			}
		}
	say "$tempMax";
	}



print("Type the numbers: \n");
chomp ( my @num =  <STDIN>);
print ("\nthe biggest number is: ");
&max(@num);

my $what = "dino";
my @from = qw/ fred barney betty dino wilma pebbles bamm-bamm /;
say "the searched word is located at index: ", &findIndex($what, @from);
say "@from";